//
//  SpringboardController.h
//  YuchBox
//
//  Created by Ivan on 11-9-28.
//  Copyright 2011年 __MyCompanyName__. All rights reserved.
//

#import <UIKit/UIKit.h>
#import "DataSource.h"

#define MAX_RETRY_TIMES 2
@interface SpringboardController : UIViewController <UITextFieldDelegate>
{
    NSArray     *_stateImages;
    NSInteger   _state;
    
    NSTimer     *_connectAnimationTimer;
    NSInteger   _animationState;
    
    UITextField *_currentEditTextField;
    
    NSTimeInterval _timeInterval;
    NSInteger   _connectRetryTimes;
    
    NSArray     *_stateString;
}
@property (strong, nonatomic) IBOutlet UITextField  *host;
@property (strong, nonatomic) IBOutlet UITextField  *port;
@property (strong, nonatomic) IBOutlet UITextField  *password;

@property (strong, nonatomic) IBOutlet UIButton     *button;

@property (strong, nonatomic) IBOutlet UILabel      *stateLabel;

- (void)eventInvoke:(DataSourceEvent)eventCode info:(id)info;

- (IBAction)toNextView:(id)sender;
- (IBAction)touchBackgroundInSide:(id)sender;
@end

@interface SpringboardController (Animation)
- (void)connectAnimation:(id)sender;
- (void)startConnectAnimationTimer;
- (void)stopConnectAnimationTimer;
@end

@interface SpringboardController (Event)
- (void)connectAnimation:(id)sender;
- (void)startConnectAnimationTimer;
- (void)stopConnectAnimationTimer;
@end